import threading
import Queue

class Work(threading.Thread):
    gq = 0;
    flagRUN = True;
    def __init__(self,ingq):
        threading.Thread.__init__(self);
        self.gq = ingq;
    def run(self):
        print "ThreadWork started";
        while(self.flagRUN):
            if self.gq.empty() != True:
                obj = self.gq.get(0);
                if obj == "exit()":
                    self.flagRUN=False;
                else:                        
                    print "Value: ",obj;
        print "ThreadWork ended.";

                

            
